-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add Pure SPA section to SPA Mode page #5139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds a new "Pure SPA" subsection to the React SPA mode documentation clarifying that SPA mode still involves a frontend server (TanStack Start) and recommending TanStack Router for a no-frontend-server SPA. No code or public API changes. Changes
Sequence Diagram(s)Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Pre-merge checks (3 passed)✅ Passed checks (3 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/start/framework/react/spa-mode.md (1)
25-28
: Clarify “Pure SPA” to avoid implying a required frontend server at runtime; add cross-links.The current wording can be read as “SPA mode still uses a frontend server for the initial document,” which conflicts with the CDN-only messaging above. Suggest replacing the paragraph and adding a note that points to the sections below.
## Pure SPA -SPA mode does not mean there is no frontend server; it's just a different way for the client to interact with your frontend (i.e., TanSatck Start) server. If you need to do an SPA with no frontend server, then [TanStack Router](https://tanstack.com/router/latest) will be a better fit for your project. +SPA mode doesn’t mean “no Start.” It generates a static shell and assets you can host on a CDN. You can still optionally deploy TanStack Start server functions or server routes for backend capabilities. If you want a client‑only SPA with no Start server/runtime, use [TanStack Router](https://tanstack.com/router/latest). + +> [!NOTE] +> If you’re mixing SPA mode with server capabilities, see [Allowing Server Functions and Server Routes](#allowing-server-functions-and-server-routes). For how data can appear in the shell during prerender, see [Dynamic Data in your Shell](#dynamic-data-in-your-shell).
Let me know if you think this is an alright addition to the SPA Mode page. I spent like a whole day trying to get SPA mode to work without an FE server before asking in the Discord and learning that that is antithetical to the ethos of Start. Something akin to this would have saved me a lot of time by directing me to Router alone much sooner.
After the first sentence, there could also be another sentence added explaining
I left it out because I didn't know if it was overexplaining.
Another option is maybe adding a sentence in the Why use Start without SSR? section to clarify better. I guess what I'm looking for is something on the SPA docs specifying that Start is an obligate server environment and enabling SPA doesn't opt you out of that, it merely changes how you interact with said server. I.e., if you want to bring your own server, you must daisy chain it to the Start server.
My position is that I'm in a company with a large Java backend. They would like us to rewrite the FE, but they don't want to add infra for an FE server. Ergo, I saw SPA mode and thought that I could use Start, but such is not the case.
Summary by CodeRabbit